-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix site view counter #34
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, not tested yet. In this status I can't merge it, cause of deployment issues.
Still its hacktoberfest-accepted
There may are some complications, in use of Vercel. Since it's the free Version.
But I see in the Error of the deployment.
There are many warnings and the note on the bottom, that openssl is not allowed.
I think that's needs to be required for the database.
Thanks for your contribution.
May there is another more simply way.
@@ -0,0 +1,16 @@ | |||
require('dotenv').config(); // Load environment variables from .env file | |||
const mongoose = require('mongoose'); | |||
const mongoURI = `mongodb+srv://saura8668:${process.env.USER_KEY}@cluster0.c48azqk.mongodb.net/viewcount`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here is missing the .env File
Isnt it possible to run mongo db on this same server?
If not, I rather configure this.
useNewUrlParser: true, | ||
useUnifiedTopology: true, | ||
}); | ||
console.log(`MongoDB Connected ${conn.connection.host}-${conn.connection.port}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more a dev only thing, don't want to show in prod
|
||
const PORT = 3030 | ||
app.listen(PORT, () => { | ||
console.log(`Server running on port ${PORT}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dev only please
Kudos, SonarCloud Quality Gate passed! |
Fix the site view counter issue by creating backend logic using NodeJS and MongoDB Atlas